package com.geoway.adf.report.excel.util;

import com.alibaba.fastjson2.JSONArray;
import com.geoway.adf.report.excel.sheet.Cell;
import com.geoway.adf.report.excel.sheet.InitCell;
import com.geoway.adf.report.excel.sheet.Sheet;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @Author: lzw
 * @Date: 2024/1/24 9:36
 * @Description:
 */
public class Converter {

    public static void initCellData(Sheet sheet){
        List<InitCell> celldata = sheet.getCelldata();
        celldata.clear();
        List<List<Cell>> data = sheet.getData();
        for(int i=0; i<data.size(); i++){
            List<Cell> cells = data.get(i);
            for(int j=0; j<cells.size(); j++){
                Cell cell = cells.get(j);
                if(null != cell){
                    celldata.add(new InitCell().setR(i).setC(j).setV(cell));
                }
            }
        }
    }
}
